home *** CD-ROM | disk | FTP | other *** search
- Subject: ODF R1 RefCounting Extensio
- Sent: 5/30/96 4:32 PM
- Received: 5/30/96 4:51 PM
- From: Kirk Swenson, kswenson@mail.keypress.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- In ODF R1, calling FW_CExtensionManager::AcquireExtension() for our extension
- never Acquire()'s the extension if it has to create it, so the refcount
- remains 0, and a subsequent Release() leads to a warning from OpenDoc. For a
- cached part such as ours, subsequent uses of the extension don't have a
- problem because FW_CExtensionManager::AcquireExtension() does Acquire() the
- extension if it is only retrieving it from the cache.
-
- I suspect that the line:
-
- acquiredExtension->Acquire(ev);
-
- should be inserted into the following code in
- FW_CExtensionManager::AcquireExtension:
-
- if (pair->fValue.fCreateFunction)
- {
- acquiredExtension = (pair->fValue.fCreateFunction)
- (ev, fPart, name, pair->fValue.fRefCon);
- acquiredExtension->Acquire(ev); // New line to increment refcount
- pair->fValue.fExtension = acquiredExtension;
- }
-
- Alternatively, the extension's CreateFunction could Acquire() the extension,
- but the documentation does not indicate this and it seems inappropriate to
- me. One might want to create the extension before there are any clients (for
- caching purposes, for instance).
-
- Is this a bug in FW_CExtensionManager::AcquireExtension, or have I missed
- something?
-
- Kirk Swenson
- Senior Software Engineer
- Key Curriculum Press
- kswenson@keypress.com
-
-